<template>
	<view class="duty-box">
		<view class="duty-person" v-for="(item,index) in dutyList" :key="index"> {{item.pNameS}}</view>

	</view>
</template>

<script>
	import { fetchData } from '../../utils/request';
	import  {mapState} from 'vuex'
	export default {
		name:"onDuty",
		data() {
			return {
				dutyList:[]
			};
		},
		methods:{
			async getDutyList(){
			const days = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
	      const date = new Date();
	      const weeks = days[date.getDay()];
				let res = await fetchData({
				        url:`/database/person/info/selectRuleHygienList`,
						data:{
							classId:this.classId,
							weeks
						},
				        method:'GET'
				    })
					
				 this.dutyList = res.data;
			},
		},
		mounted(){
			this.getDutyList();
		}
	}
</script>

<style lang="scss">
.duty-box {
	display: flex;
	    position: absolute;
	    left: 120upx;
	    top: 20upx;
		font-size:7.03rpx;
	.duty-person {
		background: url($imageurl+'/icon_person.png') left top no-repeat;
		background-size:9upx;
		padding-left:12.63upx;
		margin-right: 3.91upx;
	}
}
</style>